const fse = require('fs-extra');
const path = require('path');

module.exports = new Proxy({}, {
    get(target, module_name) {
        // 注意区分__dirname、process.cwd()
        source = path.join(__dirname, `./${module_name}.js`);
        return fse.existsSync(source) ? require(source) : {
            message: "目录出错或文件不存在, 请检查目录文件"
        };
    }
})